Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a work-in-progress chatbot feature for the voting advice application, representing a significant expansion of functionality across multiple packages.
Changes:
- Added a new
@openvaa/chatbotpackage containing core chatbot logic, RAG services, and conversation management - Implemented admin app infrastructure with job monitoring, argument condensation, and question info generation features
- Refactored LLM-related packages to use a new
@openvaa/llm-refactorarchitecture - Added Redis-based conversation state management and rate limiting
- Introduced new UI components for chatbot widgets, hero images, and admin job monitoring
Reviewed changes
Copilot reviewed 287 out of 498 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/chatbot/package.json | Defines dependencies and build configuration for the new chatbot package |
| packages/chatbot/HANDOFF.md | Documents TODOs and technical debt for future chatbot development |
| packages/argument-condensation/* | Refactored to use llm-refactor package and updated type definitions |
| packages/app-shared/src/settings/* | Extended settings types to support admin app and new hero content |
| frontend/src/routes/[[lang=locale]]/admin/* | New admin app routes and components for job management |
| frontend/src/routes/[[lang=locale]]/api/* | New API routes for authentication, chat, and admin job management |
| frontend/src/lib/components/chatbot/* | New chatbot UI components including widget and toggle button |
| frontend/src/lib/components/hero/* | New hero component supporting both emoji and image content |
| frontend/src/lib/server/redis/* | Redis client and stores for conversation state and rate limiting |
| backend/vaa-strapi/src/api/admin-job/* | New Strapi collection type for persisting admin job results |
| backend/vaa-strapi/src/policies/user-is-admin.ts | New policy to restrict admin-only routes |
| docker-compose.dev.yml | Added Redis service configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "build:cjs": "yarn package:cjs && yarn exec tsc --build tsconfig.cjs.json", | ||
| "build:esm": "yarn package:esm && yarn exec tsc --build tsconfig.esm.json", | ||
| "build": "yarn build:cjs && yarn build:esm", | ||
| "build": "yarn tsc --build && yarn tsc-esm-fix && mkdir -p build/core/condensation/prompts && find src/core/condensation/prompts -mindepth 1 -maxdepth 1 -type d -exec cp -R {} build/core/condensation/prompts/ \\;", |
There was a problem hiding this comment.
The build command contains complex shell logic with escaped characters. Consider moving this to a separate build script file (e.g., scripts/build.sh) for better maintainability and cross-platform compatibility.
| "build": "yarn tsc --build && yarn tsc-esm-fix && mkdir -p build/core/condensation/prompts && find src/core/condensation/prompts -mindepth 1 -maxdepth 1 -type d -exec cp -R {} build/core/condensation/prompts/ \\;", | |
| "build": "bash ./scripts/build-argument-condensation.sh", |
| REFINE: 'Refine', | ||
| GROUND: 'Ground', | ||
| ROOT: 'Root', | ||
| EMPTY: '?' |
There was a problem hiding this comment.
Replacing emoji icons with text labels reduces visual clarity in the visualization tool. Consider keeping emojis for better user experience or making this configurable.
| EMPTY: '?' | |
| EMPTY: '❓' |
| $: canSubmit = status !== 'loading' && registrationKey !== '' && (status !== 'error' || changedAfterCheck); | ||
| $: { | ||
| // Mark the input field as changed so we re-enable the submit button without hiding the error message | ||
| changedAfterCheck = true; | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-expressions | ||
| registrationKey; | ||
| } |
There was a problem hiding this comment.
The reactive statement with an unused expression and eslint-disable comment is a code smell. Consider using a more explicit approach, such as an on:input handler on the registration key input field to set changedAfterCheck = true.
| maxRequests = 20, // 20 requests | ||
| windowSeconds = 60 // per 60 seconds |
There was a problem hiding this comment.
Magic numbers for rate limiting are hardcoded in constructor defaults. Consider defining these as named constants (e.g., DEFAULT_MAX_REQUESTS, DEFAULT_WINDOW_SECONDS) for better maintainability.
| params, | ||
| request | ||
| }: StrapiContext): Promise<Data.ContentType<'api::question.question'>> { | ||
| console.error({ params }); |
There was a problem hiding this comment.
Debug console.error statement should be removed before merging to production. Use proper logging or remove this line.
| console.error({ params }); |
cd4585c to
da0955b
Compare
- typing for source segments - vector store interface & concrete Chroma implementation - text embedder interface & concrete OpenAI implementation - local file system for saving analyzed segments - reranking utility function using Cohere
- it is expected that main will contain the latest llm package - this should thus not mess with commit history of the main branch
… logic for documents - metadata extraction is done for full documents - fact extraction & summarization is done for each segment in the document
- processText is a subset of processPdf - only difference is pdf extraction step - handles metadata extraction, segmentation, fact extraction and segment summaries
da0955b to
9f19727
Compare
WHY:
Introduces a WIP version of the chatbot.
Rebased on
mainon 28 Jan 2026 (commit f5684c9).What has been changed (if possible, add screenshots, gifs, etc. )
Check off each of the following tasks as they are completed